home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Tool Chest / QuickDraw GX / QuickDraw GX Info / QuickDraw GX Interfaces / Interfaces & Libraries / interfaces / PrintingManager.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-24  |  25.8 KB  |  1,013 lines  |  [TEXT/MPS ]

  1. /* ------------------------------------------------------------------------------
  2.  
  3. FILENAME
  4.     PrintingManager.h
  5.  
  6. DESCRIPTION
  7.         This file defines all the public level data types
  8.         and interface calls for the Printing Manager.
  9.     
  10. COPYRIGHT
  11.      © Apple Computer, Inc. 1990, 1991, 1992, 1993
  12.      All rights reserved. 
  13.  
  14. -------------------------------------------------------------------------------- */
  15.  
  16. #ifndef __PRINTINGMANAGER__
  17. #define __PRINTINGMANAGER__
  18.  
  19.  
  20. #ifndef __PRINTING__
  21.     #include <Printing.h>
  22. #endif
  23.  
  24. #ifndef __FILES__
  25.     #include <Files.h>
  26. #endif
  27.  
  28. #ifndef __COLLECTIONMANAGER__
  29.     #include <Collections.h>
  30. #endif
  31.  
  32. #ifndef __PRINTINGERRORS__
  33.     #include <PrintingErrors.h>
  34. #endif
  35.  
  36. #ifndef graphicsTypesIncludes
  37.     #include <graphics types.h>
  38. #endif
  39.  
  40. #ifndef fontTypesIncludes
  41.     #include <font types.h>
  42. #endif
  43.  
  44. #ifndef scalerTypeIncludes
  45.     #include <scaler types.h>
  46. #endif
  47.  
  48. /* ------------------------------------------------------------------------------
  49.  
  50.                             Printing Manager API Contants and Types
  51.  
  52. -------------------------------------------------------------------------------- */
  53.  
  54.  
  55.  
  56. /* GX Printing Manager & Overall GX Gestalt Selectors... */
  57.  
  58.  
  59. #define gestaltGXPrintingMgrVersion 'pmgr'
  60. #define gestaltGXVersion                 'qdgx'
  61.  
  62.  
  63. /*--------------------------*/
  64. /* abstract data types...   */
  65. /*--------------------------*/
  66.  
  67.  
  68.  
  69. typedef struct gxPrivatePrinterRecord *gxPrinter;
  70. typedef struct    gxPrivateJobRecord *gxJob;
  71. typedef struct gxPrivateFormatRecord *gxFormat;
  72. typedef struct gxPrivatePaperTypeRecord *gxPaperType;
  73. typedef struct gxPrivatePrintFileRecord *gxPrintFile;
  74.  
  75.  
  76.  
  77. /*----------------------------------------*/
  78. /* new function constants and types...    */
  79. /*----------------------------------------*/
  80.  
  81.  
  82.  
  83. typedef Boolean gxLoopStatus;
  84.  
  85. enum {                        // possible values for LoopStatus
  86.     gxStopLooping = false,
  87.     gxKeepLooping = true
  88. };
  89.  
  90. typedef pascal gxLoopStatus (*gxViewDeviceProc) (gxViewDevice, void *refCon);
  91. typedef pascal gxLoopStatus (*gxFormatProc) (gxFormat, void *refCon);
  92. typedef pascal gxLoopStatus (*gxPaperTypeProc) (gxPaperType, void *refCon);
  93.  
  94. typedef pascal OSErr (*gxPrintingFlattenProc) (long size, void *data, void *refCon);
  95.  
  96.  
  97.  
  98. /*----------------------------------------------*/
  99. /* printing collection constants and types...    */
  100. /*----------------------------------------------*/
  101.  
  102.  
  103. // The following constants are used to set collection item flags in printing collections.
  104. // The Printing Manager purges certain items whenever a driver switch occurs.
  105. // If the formatting driver changes, all items marked as gxVolatileFormattingDriverCategory
  106. // will be purged.  If the output driver changes, all items marked as
  107. // gxVolatileOutputDriverCategory will be purged.
  108. // Note that to prevent items from being flattened when GXFlattenJob is called, you should
  109. // unset the collectionPersistenceBit (defined in Collections.h), which is on by default.
  110.  
  111.  
  112. typedef short gxCollectionCategory;        // stored in collection items' user attribute bits
  113.  
  114. enum {
  115.     gxNoCollectionCategory            = (gxCollectionCategory) 0x0000,
  116.     gxOutputDriverCategory            = (gxCollectionCategory) 0x0001,
  117.     gxFormattingDriverCategory        = (gxCollectionCategory) 0x0002,
  118.     gxDriverVolatileCategory        = (gxCollectionCategory) 0x0004,
  119.     
  120.     gxVolatileOutputDriverCategory = gxOutputDriverCategory + gxDriverVolatileCategory,
  121.     gxVolatileFormattingDriverCategory = gxFormattingDriverCategory + gxDriverVolatileCategory
  122. };
  123.  
  124.  
  125.  
  126. /*-----------------------------*/
  127. /* printing collection tags... */
  128. /*-----------------------------*/
  129.  
  130.  
  131.  
  132. enum { gxPrintingTagID = -28672 };            // all pre-defined tags have this ID
  133.  
  134.  
  135.  
  136. /*--------------------------*/
  137. /* job collection tags...   */
  138. /*--------------------------*/
  139.  
  140.  
  141.  
  142. enum { gxJobTag = 'job ' };
  143.  
  144.     enum {                                         // priorities for jobs
  145.         gxPrintJobUrgent    = 0x00000001,
  146.         gxPrintJobAtTime    = 0x00000002, 
  147.         gxPrintJobASAP        = 0x00000003
  148.     };
  149.     
  150.     enum { gxPrintJobHoldingBit = 0x00001000 };    // reserved bit in the priority field means the job is on hold
  151.     
  152.     enum {
  153.         gxPrintJobHolding            = (gxPrintJobHoldingBit + gxPrintJobASAP),
  154.         gxPrintJobHoldingAtTime    = (gxPrintJobHoldingBit + gxPrintJobAtTime),
  155.         gxPrintJobHoldingUrgent    = (gxPrintJobHoldingBit + gxPrintJobUrgent)
  156.     };
  157.     
  158.     enum {                                        // ===== Job Alert User constants (jobAlert field) =====
  159.         gxNoPrintTimeAlert    =    0,                    // don't alert user when we print
  160.         gxAlertBefore            =    1,                    // alert user before we print
  161.         gxAlertAfter            =    2,                    //    alert user after we print
  162.         gxAlertBothTimes        =    3                    //    alert before and after we print
  163.     };
  164.         
  165.     enum {                                        // ===== Job Timeout constants (jobTimeout field) =====
  166.         gxThirtySeconds        =    1800,                // 30 seconds in ticks
  167.         gxTwoMinutes            =    7200                // 2 minutes in ticks
  168.     };    
  169.  
  170.     struct gxJobInfo{
  171.         long    numPages;
  172.         long    priority;
  173.         long    timeToPrint;
  174.         long    jobTimeout;                // in ticks
  175.         long    firstPageToPrint;        // start printing from this page
  176.         short    jobAlert;
  177.         Str31    appName;
  178.         Str31 documentName;
  179.         Str31 userName;
  180.     };
  181.     
  182.     typedef struct gxJobInfo gxJobInfo;
  183.  
  184. enum { gxCollationTag = 'sort' };
  185.  
  186.     struct gxCollationInfo{
  187.         Boolean collation;                    // true if copies are to be collated
  188.     };
  189.     
  190.     typedef struct gxCollationInfo gxCollationInfo;
  191.  
  192. enum { gxCopiesTag = 'copy' };
  193.  
  194.     struct gxCopiesInfo{
  195.         long copies;                            // number of copies of document to print
  196.     };
  197.     
  198.     typedef struct gxCopiesInfo gxCopiesInfo;
  199.  
  200. enum { gxPageRangeTag = 'rang' };
  201.  
  202.     enum {                                        // for optionChosen field in SimplePageRangeInfo
  203.         gxDefaultPageRange        = (char) 0,
  204.         gxReplacePageRange        = (char) 1,
  205.         gxCustomizePageRange        = (char) 2
  206.     };
  207.  
  208.     struct gxSimplePageRangeInfo{
  209.         char            optionChosen;                    // from options listed above
  210.         Boolean        printAll;                        // true if user wants to print all pages
  211.         long            fromPage;                        // for gxDefaultPageRange, current value
  212.         long            toPage;                            // for gxDefaultPageRange, current value
  213.     };
  214.     
  215.     typedef struct gxSimplePageRangeInfo gxSimplePageRangeInfo;
  216.  
  217.     struct gxPageRangeInfo{
  218.         gxSimplePageRangeInfo    simpleRange;        // info which will be returned for GetJobPageRange        
  219.         Str31                            fromString;            // for gxCustomizePageRange, current value
  220.         Str31                            toString;            // for gxCustomizePageRange, current value
  221.         long                            minFromPage;        // for gxDefaultPageRange, we parse with this, ignored if nil
  222.         long                            maxToPage;            // for gxDefaultPageRange, we parse with this, ignored if nil
  223.         char                            replaceString[1];    // for gxReplacePageRange, string to display
  224.     };
  225.     
  226.     typedef struct gxPageRangeInfo gxPageRangeInfo;
  227.  
  228. enum { gxQualityTag = 'qual' };
  229.  
  230.     struct gxQualityInfo{
  231.         Boolean    disableQuality;            // true to disable standard quality controls
  232.         short        defaultQuality;
  233.         short        currentQuality;
  234.         short        qualityCount;                // number of quality menu items in popup menu
  235.         char        qualityNames[1];            // array of packed pascal strings for popup menu titles
  236.     };
  237.     
  238.     typedef struct gxQualityInfo gxQualityInfo;
  239.  
  240. enum { gxFileDestinationTag = 'dest' };
  241.  
  242.     struct gxFileDestinationInfo{
  243.         Boolean toFile;                        // true if destination is a file
  244.     };
  245.     
  246.     typedef struct gxFileDestinationInfo gxFileDestinationInfo;
  247.  
  248. enum { gxFileLocationTag = 'floc' };
  249.  
  250.     struct gxFileLocationInfo{
  251.         FSSpec fileSpec;                        // location to put file, if destination is file
  252.     };
  253.     
  254.     typedef struct gxFileLocationInfo gxFileLocationInfo;
  255.  
  256. enum { gxFileFormatTag = 'ffmt' };
  257.  
  258.     struct gxFileFormatInfo{
  259.         Str31 fileFormatName;                // name of file format if destination is file
  260.     };
  261.     
  262.     typedef struct gxFileFormatInfo gxFileFormatInfo;
  263.  
  264. enum { gxFileFontsTag = 'incf' };
  265.  
  266.     enum {                                         // font include level
  267.         gxIncludeNoFonts    = (char) 1,
  268.         gxIncludeAllFonts    = (char) 2, 
  269.         gxIncludeNonStandardFonts = (char) 3
  270.     };
  271.     struct gxFileFontsInfo{
  272.         char includeFonts;                // including fonts, if destination is file
  273.     };
  274.     
  275.     typedef struct gxFileFontsInfo gxFileFontsInfo;
  276.  
  277. enum { gxPaperFeedTag = 'feed' };
  278.  
  279.     struct gxPaperFeedInfo{
  280.         Boolean    autoFeed;                    // true if automatic feed, false if manual
  281.     };
  282.     
  283.     typedef struct gxPaperFeedInfo gxPaperFeedInfo;
  284.  
  285. typedef long gxTrayIndex;                        // type of tray index reference
  286.  
  287. enum { gxTrayFeedTag = 'tray' };            // public Printing Manager tray setting
  288.  
  289.     struct gxTrayFeedInfo{
  290.         gxTrayIndex feedTrayIndex;            // tray to feed paper from
  291.         Boolean manualFeedThisPage;        // signals manual feeding for the page
  292.     };
  293.     
  294.     typedef struct gxTrayFeedInfo gxTrayFeedInfo;
  295.  
  296. enum { gxManualFeedTag = 'manf' };
  297.  
  298.     struct gxManualFeedInfo{
  299.         long    numPaperTypeNames;            // number of paperTypes to manually feed
  300.         Str31    paperTypeNames[1];            // array of names of paperTypes to manually feed
  301.     };
  302.     
  303.     typedef struct gxManualFeedInfo gxManualFeedInfo;
  304.  
  305. enum { gxNormalMappingTag = 'nmap' };
  306.  
  307.     struct gxNormalMappingInfo{
  308.         Boolean normalPaperMapping;        // true if not overriding normal paper mapping
  309.     };
  310.     
  311.     typedef struct gxNormalMappingInfo gxNormalMappingInfo;
  312.  
  313. enum { gxSpecialMappingTag = 'smap' };
  314.  
  315.     enum {                                        // for paperMapping field in SpecialMappingInfo
  316.         gxRedirectPages            = (char) 1,
  317.         gxScalePages                = (char) 2,
  318.         gxTilePages                = (char) 3
  319.     };
  320.  
  321.     struct gxSpecialMappingInfo{
  322.         char specialMapping;                    // enumerated redirect, scale or tile setting
  323.     };
  324.     
  325.     typedef struct gxSpecialMappingInfo gxSpecialMappingInfo;
  326.  
  327. enum { gxTrayMappingTag = 'tmap' };
  328.  
  329.     struct gxTrayMappingInfo{
  330.         gxTrayIndex mapPaperToTray;            // tray to map all paper to
  331.     };
  332.     
  333.     typedef struct gxTrayMappingInfo gxTrayMappingInfo;
  334.  
  335. enum { gxPaperMappingTag = 'pmap' };
  336.  
  337.     // This collection item contains a flattened paper type resource
  338.  
  339. enum { gxPrintPanelTag = 'ppan' };
  340.  
  341.     struct gxPrintPanelInfo{
  342.         Str31 startPanelName;                // name of starting panel in job print dialog
  343.     };
  344.     
  345.     typedef struct gxPrintPanelInfo gxPrintPanelInfo;
  346.  
  347. enum { gxFormatPanelTag = 'fpan' };
  348.  
  349.     struct gxFormatPanelInfo{
  350.         Str31 startPanelName;                // name of starting panel in format dialog
  351.     };
  352.     
  353.     typedef struct gxFormatPanelInfo gxFormatPanelInfo;
  354.  
  355. enum { gxTranslatedDocumentTag = 'trns' };
  356.  
  357.     struct gxTranslatedDocumentInfo {
  358.         long translatorInfo;                // information from the translation process
  359.     };
  360.     
  361.     typedef struct gxTranslatedDocumentInfo gxTranslatedDocumentInfo;
  362.  
  363.  
  364.  
  365. /*--------------------------*/
  366. /* format collection tags...*/
  367. /*--------------------------*/
  368.  
  369.  
  370.  
  371. enum { gxPaperTypeLockTag = 'ptlk' };        // paperType lock tag
  372.  
  373.     struct gxPaperTypeLockInfo{
  374.         Boolean paperTypeLocked;            // true if format's paperType is locked
  375.     };
  376.     
  377.     typedef struct gxPaperTypeLockInfo gxPaperTypeLockInfo;
  378.  
  379. enum { gxOrientationTag = 'layo' };
  380.  
  381.     enum {                                        // for orientation field in orientationTag
  382.         gxPortraitLayout                 = (char) 0,
  383.         gxLandscapeLayout             = (char) 1,
  384.         gxRotatedPortraitLayout     = (char) 2,
  385.         gxRotatedLandscapeLayout     = (char) 3
  386.     };
  387.     
  388.     struct gxOrientationInfo{
  389.         char orientation;                        // an enumerated orientation value
  390.     };
  391.     
  392.     typedef struct gxOrientationInfo gxOrientationInfo;
  393.  
  394. enum { gxScalingTag = 'scal' };
  395.  
  396.     struct gxScalingInfo{
  397.         Fixed horizontalScaleFactor;        // current horizontal scaling factor
  398.         Fixed verticalScaleFactor;            // current vertical scaling factor
  399.         short minScaling;                        // minimum current scaling
  400.         short maxScaling;                        // maximum current scaling
  401.     };
  402.     
  403.     typedef struct gxScalingInfo gxScalingInfo;
  404.  
  405. enum { gxDirectModeTag = 'dirm' };
  406.  
  407.     struct gxDirectModeInfo{
  408.         Boolean directModeOn;                // true if direct mode is enabled
  409.     };
  410.     
  411.     typedef struct gxDirectModeInfo gxDirectModeInfo;
  412.  
  413. enum { gxFormatHalftoneTag = 'half' };
  414.  
  415.     struct gxFormatHalftoneInfo{
  416.         long numHalftones;                    // how many halftones
  417.         gxHalftone    halftones[1];             // any number of halftones
  418.     };
  419.     
  420.     typedef struct gxFormatHalftoneInfo gxFormatHalftoneInfo;
  421.  
  422. enum { gxInvertPageTag = 'invp' };
  423.  
  424.     struct    gxInvertPageInfo{
  425.         Boolean        invert;                        // true -> invert the page
  426.     };                            // missing | false -> don't invert the page
  427.     
  428.     typedef struct gxInvertPageInfo gxInvertPageInfo;
  429.  
  430. enum { gxFlipPageHorizontalTag = 'flph' };
  431.  
  432.     struct    gxFlipPageHorizontalInfo{
  433.         Boolean        flipHorizontal;        // true -> flip x coordinates on the page
  434.     };            // missing | false -> don't flip horizontally
  435.     
  436.     typedef struct gxFlipPageHorizontalInfo gxFlipPageHorizontalInfo;
  437.     
  438. enum { gxFlipPageVerticalTag = 'flpv' };
  439.  
  440.     struct    gxFlipPageVerticalInfo{
  441.         Boolean        flipVertical;            // true -> flip y coordinates on the page
  442.     };                // missing | false -> don't flip vertically
  443.     
  444.     typedef struct gxFlipPageVerticalInfo gxFlipPageVerticalInfo;
  445.     
  446. enum { gxPreciseBitmapsTag = 'pbmp' };
  447.     
  448.     struct gxPreciseBitmapInfo{
  449.         Boolean        preciseBitmaps;        // true -> scale the page by 96%
  450.     };                    // missing | false -> don't scale the page by 96%
  451.     
  452.     typedef struct gxPreciseBitmapInfo gxPreciseBitmapInfo;
  453.  
  454.  
  455.  
  456. /*-----------------------------*/
  457. /* paperType collection tags...*/
  458. /*-----------------------------*/
  459.  
  460.  
  461.  
  462. enum { gxBaseTag = 'base' };
  463.  
  464.     enum {                                            // for baseType field in baseTag
  465.         gxUnknownBase        =    0,                        // base paper type from which this paper type is
  466.         gxUSLetterBase        =    1,                        // derived.  This is not a complete set.
  467.         gxUSLegalBase        =    2,
  468.         gxA4LetterBase        =    3,
  469.         gxB5LetterBase        =    4,
  470.         gxTabloidBase        =    5
  471.     };
  472.     
  473.     struct gxBaseInfo{
  474.         long baseType;                            // paperType's base type
  475.     };
  476.     
  477.     typedef struct gxBaseInfo gxBaseInfo;
  478.  
  479. enum { gxCreatorTag = 'crea' };
  480.  
  481.     enum {                                        // for creator field in creatorTag
  482.         gxSysPaperType            =    'sypt',        // system paper type creator
  483.         gxUserPaperType        =    'uspt'        // user paper type creator
  484.                                                         // if driver paperTypes then = driver's creator type
  485.     };
  486.     
  487.     struct gxCreatorInfo{
  488.         OSType creator;                        // paperType's creator
  489.     };
  490.     
  491.     typedef struct gxCreatorInfo gxCreatorInfo;
  492.  
  493. enum { gxUnitsTag = 'unit' };
  494.  
  495.     enum {                                        // for units field in unitsTag
  496.         gxPicas                    =    (char) 0,    // pica measurement
  497.         gxMMs                        =    (char) 1,    // millimeter measurement
  498.         gxInches                    =    (char) 2        // inches measurement
  499.     };
  500.     
  501.     struct gxUnitsInfo{
  502.         char units;                                // paperType's units
  503.     };
  504.     
  505.     typedef struct gxUnitsInfo gxUnitsInfo;
  506.  
  507. enum { gxFlagsTag = 'flag' };
  508.  
  509.     enum {                                        // paper type flags (bit positions)
  510.         gxOldPaperTypeFlag                =    0x00800000,    // indicates a paper type with 7.0 settings
  511.         gxNewPaperTypeFlag                =    0x00400000,    // indicates a paper type with post 7.0 settings
  512.         gxOldAndNewPaperTypeFlag        =    0x00C00000,    // indicates a paper type that's both old and new
  513.         gxDefaultPaperTypeFlag            =    0x00100000    //    indicates the default paper type in the group    
  514.     };
  515.     
  516.     struct gxFlagsInfo{
  517.         long flags;                                // paperType's flags
  518.     };
  519.     
  520.     typedef struct gxFlagsInfo gxFlagsInfo;
  521.  
  522. enum { gxCommentTag = 'cmnt' };
  523.  
  524.     struct gxCommentInfo{
  525.         Str255 comment;                        // paperType's comment
  526.     };
  527.     
  528.     typedef struct gxCommentInfo gxCommentInfo;
  529.  
  530.  
  531.  
  532. /*---------------------------*/
  533. /* printer viewDevice tags...*/
  534. /*---------------------------*/
  535.  
  536.  
  537.  
  538. enum { gxPenTableTag = 'pent' };
  539.  
  540.     enum {                    // possible values for the flags field in the PenTableEntry structure
  541.         gxDeviceUnits = 0,
  542.         gxMMUnits = 1,
  543.         gxInchesUnits = 2
  544.     };
  545.     
  546.     enum {    
  547.           gxPenNotLoaded     = -1
  548.     };
  549.     
  550.     struct gxPenTableEntry{ 
  551.         Str31      penName;            // name of the pen
  552.         gxColor     penColor;            // color that is part of the color set
  553.         Fixed      penThickness;    // size of the pen
  554.         short      penUnits;            // specifies units in which pen thickness is defined
  555.         short      penPosition;        // pen position in the carousel, -1 (kPenNotLoaded) if not loaded
  556.     };
  557.     
  558.     typedef struct gxPenTableEntry gxPenTableEntry;
  559.          
  560.          
  561.     struct gxPenTable{
  562.         long                    numPens;        // number of pen entries in the following array
  563.         gxPenTableEntry    pens[1];        // array of pen entries
  564.     };
  565.     
  566.     typedef struct gxPenTable gxPenTable, *gxPenTablePtr, **gxPenTableHdl;
  567.  
  568.  
  569.  
  570. /*----------------------------------------*/
  571. /* dialog-related constants and types...  */
  572. /*----------------------------------------*/
  573.  
  574.  
  575.  
  576. typedef long gxDialogResult;
  577.  
  578. enum {
  579.     gxCancelSelected        = (gxDialogResult) 0,
  580.     gxOKSelected             = (gxDialogResult) 1,
  581.     gxRevertSelected        = (gxDialogResult) 2
  582. };
  583.  
  584.  
  585. struct gxEditMenuRecord{
  586.     short    editMenuID;
  587.     short    cutItem;
  588.     short    copyItem;
  589.     short    pasteItem;
  590.     short    clearItem;
  591.     short    undoItem;
  592. };
  593.  
  594. typedef struct gxEditMenuRecord gxEditMenuRecord;
  595.  
  596.  
  597. /*-----------------------------------------*/
  598. /* job format mode constants and types...  */
  599. /*-----------------------------------------*/
  600.  
  601.  
  602.  
  603. typedef long gxQueryType;
  604.  
  605. enum {
  606.     gxGetJobFormatLineConstraintQuery        = (gxQueryType)  0,
  607.     gxGetJobFormatFontsQuery                    = (gxQueryType)  1,
  608.     gxGetJobFormatFontCommonStylesQuery        = (gxQueryType)  2,
  609.     gxGetJobFormatFontConstraintQuery        = (gxQueryType)  3,
  610.     gxSetStyleJobFormatCommonStyleQuery        = (gxQueryType)  4
  611. };
  612.  
  613.  
  614. typedef OSType gxJobFormatMode;
  615.  
  616. enum {
  617.     gxGraphicsJobFormatMode        = (gxJobFormatMode) 'grph',
  618.     gxTextJobFormatMode            = (gxJobFormatMode) 'text',
  619.     gxPostScriptJobFormatMode     = (gxJobFormatMode) 'post'
  620. };
  621.  
  622.  
  623. struct gxJobFormatModeTable{
  624.     long                    numModes;
  625.     gxJobFormatMode    modes[1];        // any number of modes
  626. };
  627.  
  628. typedef struct gxJobFormatModeTable gxJobFormatModeTable, *gxJobFormatModeTablePtr, **gxJobFormatModeTableHdl;
  629.  
  630.  
  631. enum { gxConstraintRange = -1 };    // in numSizes field of PositionConstraintTable to indicate a range in sizes array
  632.  
  633.  
  634. struct gxPositionConstraintTable{                        // for text mode    
  635.     gxPoint    phase;
  636.     gxPoint    offset;
  637.     long        numSizes;
  638.     Fixed        sizes[1];                // any number of sizes
  639. };
  640.  
  641. typedef struct gxPositionConstraintTable gxPositionConstraintTable, *gxPositionConstraintTablePtr, **gxPositionConstraintTableHdl;
  642.  
  643. struct gxStyleNameTable{                        // for text mode
  644.     long            numStyleNames;            // number of style names
  645.     Str255        styleNames[1];            // any number of style names
  646. };
  647.  
  648. typedef struct gxStyleNameTable gxStyleNameTable, *gxStyleNameTablePtr, **gxStyleNameTableHdl;
  649.  
  650. struct gxFontTable{                        // for text mode
  651.     long            numFonts;                // number of font references
  652.     gxFont        fonts[1];                // any number of font references
  653. };
  654.  
  655. typedef struct gxFontTable gxFontTable, *gxFontTablePtr, **gxFontTableHdl;
  656.  
  657.  
  658.  
  659. /* ------------------------------------------------------------------------------
  660.  
  661.                                 Printing Manager API Functions
  662.  
  663. -------------------------------------------------------------------------------- */
  664.  
  665.  
  666. #define GXPUBLICAPIGLUE(selector) {0x203C, 0x0000, selector, 0xABFE}
  667.  
  668.  
  669. #ifdef __cplusplus
  670. extern "C" {
  671. #endif
  672.  
  673.  
  674. // Global Routines (Basic)
  675.  
  676.  
  677. pascal OSErr GXInitPrinting (void)
  678.     = GXPUBLICAPIGLUE(0);
  679.  
  680. pascal OSErr GXExitPrinting (void)
  681.     = GXPUBLICAPIGLUE(1);
  682.  
  683.  
  684. // Job Routines (Basic)
  685.  
  686.  
  687. pascal OSErr GXNewJob (gxJob *)
  688.     = GXPUBLICAPIGLUE(2);
  689.     
  690. pascal OSErr GXDisposeJob (gxJob)
  691.     = GXPUBLICAPIGLUE(3);
  692.      
  693. pascal void GXFlattenJob (gxJob, gxPrintingFlattenProc, void *)
  694.     = GXPUBLICAPIGLUE(4);
  695.     
  696. pascal gxJob GXUnflattenJob (gxJob, gxPrintingFlattenProc, void *)
  697.     = GXPUBLICAPIGLUE(5);
  698.      
  699. pascal Handle GXFlattenJobToHdl (gxJob, Handle)
  700.     = GXPUBLICAPIGLUE(6);
  701.     
  702. pascal gxJob GXUnflattenJobFromHdl (gxJob, Handle)
  703.     = GXPUBLICAPIGLUE(7);
  704.  
  705. pascal void GXInstallApplicationOverride (gxJob, short messageID, void *override)
  706.     = GXPUBLICAPIGLUE(8);
  707.  
  708.  
  709. // Format Routines (Basic)
  710.  
  711.  
  712. pascal gxFormat GXNewFormat (gxJob)
  713.     = GXPUBLICAPIGLUE(9);
  714.     
  715. pascal void GXDisposeFormat (gxFormat)
  716.     = GXPUBLICAPIGLUE(10);
  717.     
  718.                                 
  719. // PaperType Routines (Basic)
  720.  
  721.  
  722. pascal gxPaperType GXNewPaperType (gxJob, Str31 name, gxRectangle *pageSize, gxRectangle *paperSize)
  723.     = GXPUBLICAPIGLUE(11);
  724.     
  725. pascal void GXDisposePaperType (gxPaperType)
  726.     = GXPUBLICAPIGLUE(12);
  727.  
  728. pascal gxPaperType GXGetNewPaperType (gxJob, short resID)
  729.     = GXPUBLICAPIGLUE(13);
  730.  
  731.  
  732. // Error-Handling Routines (Basic)
  733.                     
  734.                                 
  735. pascal OSErr GXGetJobError (gxJob)
  736.     = GXPUBLICAPIGLUE(14);
  737.  
  738. pascal void GXSetJobError (gxJob, OSErr)
  739.     = GXPUBLICAPIGLUE(15);
  740.  
  741.  
  742. // Dialog Routines (Basic)
  743.                     
  744.                                 
  745. pascal gxDialogResult GXJobDefaultFormatDialog (gxJob, gxEditMenuRecord *)
  746.    = GXPUBLICAPIGLUE(16);
  747.  
  748. pascal gxDialogResult GXJobPrintDialog (gxJob, gxEditMenuRecord *)
  749.    = GXPUBLICAPIGLUE(17);
  750.  
  751. pascal gxDialogResult GXFormatDialog (gxFormat, gxEditMenuRecord *, StringPtr title)
  752.     = GXPUBLICAPIGLUE(18);
  753.  
  754.                                 
  755. // Format Routines (Basic)
  756.                     
  757.                                 
  758. pascal gxFormat GXGetJobFormat (gxJob, long whichFormat)
  759.     = GXPUBLICAPIGLUE(19);
  760.     
  761. pascal gxJob GXGetFormatJob (gxFormat)
  762.     = GXPUBLICAPIGLUE(20);
  763.  
  764. pascal gxPaperType GXGetFormatPaperType (gxFormat)
  765.     = GXPUBLICAPIGLUE(21);
  766.     
  767. pascal void GXGetFormatDimensions (gxFormat, gxRectangle *pageSize, gxRectangle *paperSize)
  768.     = GXPUBLICAPIGLUE(22);
  769.     
  770.  
  771. // Spooling Routines (Basic)
  772.                     
  773.                                 
  774. pascal void GXGetJobPageRange (gxJob theJob, long *firstPage, long *lastPage)
  775.     = GXPUBLICAPIGLUE(23);
  776.     
  777. pascal void GXStartJob (gxJob, StringPtr docName, long pageCount)
  778.     = GXPUBLICAPIGLUE(24);
  779.     
  780. pascal void GXPrintPage (gxJob, long pageNumber, gxFormat, gxShape thePage)
  781.    = GXPUBLICAPIGLUE(25);
  782.         
  783. pascal Boolean GXStartPage (gxJob, long pageNumber, gxFormat, long numViewPorts, gxViewPort *viewPortList)
  784.     = GXPUBLICAPIGLUE(26);
  785.  
  786. pascal void GXFinishPage (gxJob)
  787.     = GXPUBLICAPIGLUE(27);
  788.  
  789. pascal void GXFinishJob (gxJob)
  790.     = GXPUBLICAPIGLUE(28);
  791.     
  792.  
  793. // Job Routines (Advanced)
  794.                                             
  795.  
  796. pascal Collection GXGetJobCollection (gxJob)
  797.     = GXPUBLICAPIGLUE(29);
  798.  
  799. pascal void *GXGetJobRefCon (gxJob)
  800.     = GXPUBLICAPIGLUE(30);
  801.  
  802. pascal void GXSetJobRefCon (gxJob, void *refCon)
  803.     = GXPUBLICAPIGLUE(31);
  804.     
  805. pascal gxJob GXCopyJob (gxJob srcJob, gxJob dstJob)
  806.     = GXPUBLICAPIGLUE(32);
  807.  
  808. pascal void GXSelectJobFormattingPrinter (gxJob, Str31 printerName)
  809.     = GXPUBLICAPIGLUE(33);
  810.     
  811. pascal void GXSelectJobOutputPrinter (gxJob, Str31 printerName)
  812.     = GXPUBLICAPIGLUE(34);
  813.  
  814. pascal void GXForEachJobFormatDo (gxJob, gxFormatProc, void *refCon)
  815.     = GXPUBLICAPIGLUE(35);
  816.  
  817. pascal long GXCountJobFormats (gxJob)
  818.     = GXPUBLICAPIGLUE(36);
  819.  
  820. pascal Boolean GXUpdateJob (gxJob)
  821.     = GXPUBLICAPIGLUE(37);
  822.     
  823. pascal void GXConvertPrintRecord (gxJob, THPrint)
  824.     = GXPUBLICAPIGLUE(38);
  825.  
  826.  
  827. // Printer Routines (Advanced)
  828.  
  829.  
  830. pascal gxPrinter GXGetJobFormattingPrinter (gxJob)
  831.     = GXPUBLICAPIGLUE(39);
  832.     
  833. pascal gxPrinter GXGetJobOutputPrinter (gxJob)
  834.     = GXPUBLICAPIGLUE(40);
  835.     
  836. pascal gxPrinter GXGetJobPrinter (gxJob)
  837.     = GXPUBLICAPIGLUE(41);
  838.     
  839. pascal gxJob GXGetPrinterJob (gxPrinter)
  840.     = GXPUBLICAPIGLUE(42);
  841.  
  842. pascal void GXForEachPrinterViewDeviceDo (gxPrinter, gxViewDeviceProc, void *refCon)
  843.     = GXPUBLICAPIGLUE(43);
  844.  
  845. pascal long GXCountPrinterViewDevices (gxPrinter)
  846.     = GXPUBLICAPIGLUE(44);
  847.  
  848. pascal gxViewDevice GXGetPrinterViewDevice (gxPrinter, long    whichViewDevice)
  849.     = GXPUBLICAPIGLUE(45);
  850.     
  851. pascal void GXSelectPrinterViewDevice (gxPrinter, long    whichViewDevice)
  852.     = GXPUBLICAPIGLUE(46);
  853.     
  854. pascal void GXGetPrinterName (gxPrinter, Str31)
  855.     = GXPUBLICAPIGLUE(47);
  856.  
  857. pascal OSType GXGetPrinterType (gxPrinter)
  858.     = GXPUBLICAPIGLUE(48);
  859.  
  860. pascal void GXGetPrinterDriverName (gxPrinter, Str31)
  861.     = GXPUBLICAPIGLUE(49);
  862.  
  863. pascal OSType GXGetPrinterDriverType (gxPrinter)
  864.     = GXPUBLICAPIGLUE(50);
  865.  
  866.  
  867. // Format Routines (Advanced)
  868.  
  869.  
  870. pascal Collection GXGetFormatCollection (gxFormat)
  871.     = GXPUBLICAPIGLUE(51);
  872.  
  873. pascal void GXChangedFormat (gxFormat)
  874.     = GXPUBLICAPIGLUE(52);
  875.  
  876. pascal gxFormat GXCopyFormat (gxFormat srcFormat, gxFormat dstFormat)
  877.     = GXPUBLICAPIGLUE(53);
  878.     
  879. pascal gxFormat GXCloneFormat (gxFormat)
  880.     = GXPUBLICAPIGLUE(54);
  881.         
  882. pascal long GXCountFormatOwners (gxFormat)
  883.     = GXPUBLICAPIGLUE(55);
  884.         
  885. pascal void GXGetFormatMapping (gxFormat, gxMapping *)
  886.     = GXPUBLICAPIGLUE(56);
  887.  
  888. pascal gxShape GXGetFormatForm (gxFormat, gxShape *mask)
  889.     = GXPUBLICAPIGLUE(57);
  890.     
  891. pascal void GXSetFormatForm (gxFormat, gxShape form, gxShape mask)
  892.     = GXPUBLICAPIGLUE(58);
  893.  
  894.  
  895. // Job Format Modes Routines (Advanced)
  896.  
  897.  
  898. pascal void GXSetAvailableJobFormatModes (gxJob, gxJobFormatModeTableHdl)
  899.     = GXPUBLICAPIGLUE(59);
  900.  
  901. pascal gxJobFormatMode GXGetPreferredJobFormatMode (gxJob, Boolean *directOnly)
  902.     = GXPUBLICAPIGLUE(60);
  903.  
  904. pascal gxJobFormatMode GXGetJobFormatMode (gxJob)
  905.     = GXPUBLICAPIGLUE(61);
  906.  
  907. pascal void GXSetJobFormatMode (gxJob, gxJobFormatMode)
  908.     = GXPUBLICAPIGLUE(62);
  909.  
  910. pascal void GXJobFormatModeQuery (gxJob, gxQueryType, void *srcData, void *dstData)
  911.     = GXPUBLICAPIGLUE(63);
  912.  
  913.  
  914. // Dialog Routines  (Advanced)
  915.  
  916.  
  917. pascal void GXEnableJobScalingPanel (gxJob, Boolean enabled)
  918.     = GXPUBLICAPIGLUE(64);
  919.  
  920. pascal void GXGetJobPanelDimensions (gxJob, Rect *)
  921.     = GXPUBLICAPIGLUE(65);
  922.  
  923.  
  924. // PaperType Routines (Advanced)
  925.  
  926.  
  927. pascal long GXCountJobPaperTypes (gxJob, Boolean forFormatDevice)
  928.     = GXPUBLICAPIGLUE(66);
  929.  
  930. pascal gxPaperType GXGetJobPaperType (gxJob, long whichPaperType, Boolean forFormatDevice, gxPaperType)
  931.     = GXPUBLICAPIGLUE(67);
  932.  
  933. pascal void GXForEachJobPaperTypeDo (gxJob, gxPaperTypeProc, void *refCon, Boolean forFormattingPrinter)
  934.     = GXPUBLICAPIGLUE(68);
  935.  
  936. pascal gxPaperType GXCopyPaperType (gxPaperType srcPaperType, gxPaperType dstPaperType)
  937.     = GXPUBLICAPIGLUE(69);
  938.  
  939. pascal void GXGetPaperTypeName (gxPaperType, Str31)
  940.     = GXPUBLICAPIGLUE(70);
  941.  
  942. pascal void GXGetPaperTypeDimensions (gxPaperType, gxRectangle *pageSize, gxRectangle *paperSize)
  943.     = GXPUBLICAPIGLUE(71);
  944.  
  945. pascal gxJob GXGetPaperTypeJob (gxPaperType)
  946.     = GXPUBLICAPIGLUE(72);
  947.  
  948. pascal Collection GXGetPaperTypeCollection (gxPaperType)
  949.     = GXPUBLICAPIGLUE(73);
  950.  
  951.  
  952. // PrintViewer Routines (Advanced)
  953.  
  954.  
  955. pascal gxPrintFile GXOpenPrintFile (gxJob, FSSpecPtr, char permission)
  956.     = GXPUBLICAPIGLUE(74);
  957.  
  958. pascal void GXClosePrintFile (gxPrintFile)
  959.     = GXPUBLICAPIGLUE(75);
  960.  
  961. pascal gxJob GXGetPrintFileJob (gxPrintFile)
  962.     = GXPUBLICAPIGLUE(76);
  963.  
  964. pascal long GXCountPrintFilePages (gxPrintFile)
  965.     = GXPUBLICAPIGLUE(77);
  966.  
  967. pascal void GXReadPrintFilePage (gxPrintFile, long pageNumber, long numViewPorts, gxViewPort *viewPortList, gxFormat *, gxShape *)
  968.     = GXPUBLICAPIGLUE(78);
  969.  
  970. pascal void GXReplacePrintFilePage (gxPrintFile, long pageNumber, gxFormat, gxShape)
  971.     = GXPUBLICAPIGLUE(79);
  972.  
  973. pascal void GXInsertPrintFilePage (gxPrintFile, long atPageNumber, gxFormat, gxShape)
  974.     = GXPUBLICAPIGLUE(80);
  975.  
  976. pascal void GXDeletePrintFilePageRange (gxPrintFile, long fromPageNumber, long toPageNumber)
  977.     = GXPUBLICAPIGLUE(81);
  978.  
  979. pascal void GXSavePrintFile (gxPrintFile, FSSpec *)
  980.     = GXPUBLICAPIGLUE(82);
  981.  
  982.  
  983. // ColorSync Routines (Advanced)
  984.  
  985.  
  986. pascal long GXFindPrinterProfile (gxPrinter, void * searchData, long index, gxColorProfile * returnedProfile)
  987.     = GXPUBLICAPIGLUE(83);
  988.     
  989. pascal long GXFindFormatProfile (gxFormat, void * searchData, long index, gxColorProfile * returnedProfile)
  990.     = GXPUBLICAPIGLUE(84);
  991.  
  992. pascal void GXSetPrinterProfile (gxPrinter, gxColorProfile oldProfile, gxColorProfile newProfile)
  993.     = GXPUBLICAPIGLUE(85);
  994.  
  995. pascal void GXSetFormatProfile (gxFormat, gxColorProfile oldProfile, gxColorProfile newProfile)
  996.     = GXPUBLICAPIGLUE(86);
  997.  
  998.  
  999. // Miscellaneous Routines
  1000.  
  1001.  
  1002. pascal void GXIdleJob (gxJob)
  1003.     = GXPUBLICAPIGLUE(87);
  1004.  
  1005.  
  1006. #ifdef __cplusplus
  1007. }
  1008. #endif
  1009.  
  1010.  
  1011. #endif
  1012.  
  1013.